/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.jiujiudevice.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;

/**
 * 设备配置Entity
 * @author sxh
 * @version 2018-08-15
 */
@Entity
@Table(name = "jiu_device")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class JiuDevice extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	/**
	 * 用户使用 缓存key ，用户正在使用的设备
	 * value 为订单编号
	 */
	public static final String  MEMBER_USE_DEVICE_CACHE_KEY = "MEMBER_USE_DEVICE_KEY";
	
	/**
	 * 设备缓存前缀，用于发布设备命令
	 */
	public static final String  DEVICE_RUNTIME_KEY_PREFIX = "DEVICE_RUNTIME_KEY_PREFIX";
	
	/***
	 * 设备类型前缀，用于区分设备的类型
	 */
	public static final String DEVICE_TYPE = "DEVICE_TYPE";
	
	/**
	 * 设备打开前，显示设备最新的墨盒数据
	 */
	public static final String DEVICE_CUR_DATA = "DEVICE_CUR_DATA";
	
	
	private Long id; 		// 编号
	
	private String name; 	// 名称
	/**设备sn*/
	private String sn;
	/**设备使用单价*/
	private Double price;
    /**公司id*/
	private Integer companyId;
	/**公司名称*/
	private String companyName;
	/**
	 * 创建日期
	 */
	private Date createTime;	
	/**
	 * 设备状态
	 */
	private Integer status;
	
	public JiuDevice() {
		this.createTime = new Date();
	}

	public JiuDevice(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	@Length(min=1, max=200)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	
	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public Integer getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	
}


